package _3ChapterThree._11EncapsulateCollection;


import com.sun.org.apache.xpath.internal.operations.String;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

public class Test {

    //key：学号，value：学生姓名
    Map<String, String> studentsMap = new HashMap<>();

    public Map<String, String> getStudentsMap() {
        return Collections.unmodifiableMap(studentsMap);
    }

    public String getStudentName(String sno) {
        return studentsMap.get(sno);
    }

    public void setStudentInfo(String sno, String name) {
        studentsMap.put(sno, name);
    }
}
